import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/ruoyi";

// 终端列表
export function getTerminalInfoList(params) {

  return request({
    url: '/system/terminal/list',
    method: 'post',
    data: params
  })
}

// 查询用户列表
export function getTerminalInfoDetail(id) {
  return request({
    url: '/system/terminal/detail?id=' + id,
    method: 'get'
  })
}

export function addTerminalInfo(params) {
  return request({
    url: '/system/terminal/add',
    method: 'post',
    data: params
  })
}


export function updateTerminalInfo(params) {
  return request({
    url: '/system/terminal/update',
    method: 'post',
    data: params
  })
}

export function delTerminalInfo(id) {
  return request({
    url: '/system/terminal/del?id=' + id,
    method: 'get'
  })
}

export function batchDelTerminalInfo(ids) {

  const params = {
    'ids': ids
  }

  return request({
    url: '/system/terminal/batchDel',
    method: 'post',
    data: params
  })
}

export function changeTerminalStatus(id, status) {

  const data = {
    id,
    status
  }
  return request({
    url: '/system/terminal/status',
    method: 'post',
    data: data
  })

}
